//
//  StrategyParser.m
//  ITrip
//
//  Created by dllo on 15/5/22.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "StrategyParser.h"

@implementation StrategyParser

+ (NSMutableArray *)getParser:(NSData *)data
{
    NSMutableArray *arrayData = [NSMutableArray array];
    NSArray *array = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
    for (NSDictionary *dic in array) {
        if ([[dic objectForKey:@"category"] integerValue] == 1 || [[dic objectForKey:@"category"] integerValue] == 2 || [[dic objectForKey:@"category"] integerValue] == 3 ) {
            
            NSArray *array1 = [dic objectForKey:@"destinations"];
            for (NSDictionary *dic1 in array1) {
                StrategyModel *model = [StrategyModel getModel];
                
                model.name_zh_cn = [dic1 objectForKey:@"name_zh_cn"];
                model.name_en = [dic1 objectForKey:@"name_en"];
                model.poi_count = [[dic1 objectForKey:@"poi_count"]integerValue];

                model.image = [dic1 objectForKey:@"image_url"];
                [arrayData addObject:model];
            }
        }
    }
    return arrayData;
}


    
@end